<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>CTF实验环境实例管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/scene/sceneCtfEnvironmentInstance/">CTF实验环境实例列表</a></li>
		<%--<shiro:hasPermission name="scene:sceneCtfEnvironmentInstance:edit"><li><a href="${ctx}/scene/sceneCtfEnvironmentInstance/form">CTF实验环境实例添加</a></li></shiro:hasPermission>--%>
	</ul>
	<%--<form:form id="searchForm" modelAttribute="sceneCtfEnvironmentInstance" action="${ctx}/scene/sceneCtfEnvironmentInstance/" method="post" class="breadcrumb form-search">--%>
		<%--<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>--%>
		<%--<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>--%>
		<%--<ul class="ul-form">--%>
			<%--<li><label>教学实验环境id：</label>--%>
				<%--<form:input path="id" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<%--<li><label>教学实验环境id：</label>--%>
				<%--<form:input path="ctfEnvironmentId" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<%--<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>--%>
			<%--<li class="clearfix"></li>--%>
		<%--</ul>--%>
	<%--</form:form>--%>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>实验环境名称</th>
				<th>实验时间</th>
				<th>实例生成时间</th>
				<th>实例结束时间</th>
				<th>实验环境类型</th>
				<th>实例创建用户</th>
				<th>CTF类型</th>
				<shiro:hasPermission name="scene:sceneCtfEnvironmentInstance:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="sceneCtfEnvironmentInstance">
			<tr>
				<td>
					${sceneCtfEnvironmentInstance.ctfEnvironmentName}
				</td>
				<td>
						${sceneCtfEnvironmentInstance.ctfEnvironmentTime}小时
				</td>
				<td>
					<fmt:formatDate value="${sceneCtfEnvironmentInstance.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${sceneCtfEnvironmentInstance.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
						${fns:getDictLabel(sceneCtfEnvironmentInstance.ctfEnvironmentType, 'scene_env_type', '')}
				</td>
				<td>
						${sceneCtfEnvironmentInstance.createUserName}
				</td>
				<td>
					<c:choose>
					<c:when test="${sceneCtfEnvironmentInstance.ctfType=='0'}">
						web应用型${sceneCtfEnvironmentInstance.link}
					</c:when>
					<c:otherwise>
						端口型${sceneCtfEnvironmentInstance.link}
					</c:otherwise>
					</c:choose>
				</td>
				<shiro:hasPermission name="scene:sceneCtfEnvironmentInstance:edit"><td>
					<c:choose>
						<c:when test="${sceneCtfEnvironmentInstance.ctfType=='0'}">
						<a href="${sceneCtfEnvironmentInstance.link}" target="_blank">${sceneCtfEnvironmentInstance.link}</a>
						</c:when>
						<c:otherwise>
							${sceneCtfEnvironmentInstance.ip}:${sceneCtfEnvironmentInstance.port}
						</c:otherwise>
					</c:choose>
    				<%--<a href="${ctx}/scene/sceneCtfEnvironmentInstance/form?id=${sceneCtfEnvironmentInstance.id}">修改</a>--%>
					<a href="${ctx}/scene/sceneCtfEnvironmentInstance/delete?id=${sceneCtfEnvironmentInstance.id}" onclick="return confirmx('确认要删除该实例吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>